﻿using System;
namespace Calculator.Xroad.Eu.Headers {
    
    
    [System.SerializableAttribute()]
    public partial class MultiplyOutputHeader : Xtee.Core.Envelope.Header.IHeader {
        
        private global::Xroad.Eu.Xsd.Identifiers.XRoadClientIdentifierType @__client;
        
        private global::Xroad.Eu.Xsd.Identifiers.XRoadServiceIdentifierType @__service;
        
        private string @__id;
        
        private string @__userId;
        
        private string @__issue;
        
        private string @__protocolVersion;
        
        private MultiplyOutputHeader.RequestHashType @__requestHash;
        
        public MultiplyOutputHeader() {
        }
        
        /// <summary>
        /// All parameters
        /// </summary>
        public MultiplyOutputHeader(global::Xroad.Eu.Xsd.Identifiers.XRoadClientIdentifierType @client, global::Xroad.Eu.Xsd.Identifiers.XRoadServiceIdentifierType @service, string @id, string @userId, string @issue, string @protocolVersion, MultiplyOutputHeader.RequestHashType @requestHash) {
            this.@__client = @client;
            this.@__service = @service;
            this.@__id = @id;
            this.@__userId = @userId;
            this.@__issue = @issue;
            this.@__protocolVersion = @protocolVersion;
            this.@__requestHash = @requestHash;
        }
        
        /// <summary>
        /// Required parameters
        /// </summary>
        public MultiplyOutputHeader(global::Xroad.Eu.Xsd.Identifiers.XRoadClientIdentifierType @client, global::Xroad.Eu.Xsd.Identifiers.XRoadServiceIdentifierType @service, string @id, string @userId, string @issue, string @protocolVersion) {
            this.@__client = @client;
            this.@__service = @service;
            this.@__id = @id;
            this.@__userId = @userId;
            this.@__issue = @issue;
            this.@__protocolVersion = @protocolVersion;
        }
        
        /// <summary>
        /// Copy Constructor
        /// </summary>
        protected MultiplyOutputHeader(MultiplyOutputHeader @multiplyOutputHeader) {
            this.@__client = @multiplyOutputHeader.Client;
            this.@__service = @multiplyOutputHeader.Service;
            this.@__id = @multiplyOutputHeader.Id;
            this.@__userId = @multiplyOutputHeader.UserId;
            this.@__issue = @multiplyOutputHeader.Issue;
            this.@__protocolVersion = @multiplyOutputHeader.ProtocolVersion;
            this.@__requestHash = @multiplyOutputHeader.RequestHash;
        }
        
        public virtual global::Xroad.Eu.Xsd.Identifiers.XRoadClientIdentifierType Client {
            get {
                return this.@__client;
            }
            set {
                this.@__client = value;
            }
        }
        
        public virtual global::Xroad.Eu.Xsd.Identifiers.XRoadServiceIdentifierType Service {
            get {
                return this.@__service;
            }
            set {
                this.@__service = value;
            }
        }
        
        public virtual string Id {
            get {
                return this.@__id;
            }
            set {
                this.@__id = value;
            }
        }
        
        public virtual string UserId {
            get {
                return this.@__userId;
            }
            set {
                this.@__userId = value;
            }
        }
        
        public virtual string Issue {
            get {
                return this.@__issue;
            }
            set {
                this.@__issue = value;
            }
        }
        
        public virtual string ProtocolVersion {
            get {
                return this.@__protocolVersion;
            }
            set {
                this.@__protocolVersion = value;
            }
        }
        
        public virtual MultiplyOutputHeader.RequestHashType RequestHash {
            get {
                return this.@__requestHash;
            }
            set {
                this.@__requestHash = value;
            }
        }
        
        public virtual string GetServiceName() {
            return Xtee.Core.Adapter.Service.ServiceNameProvider.GetName(Service);
        }
        
        public virtual string GetUserId() {
            return !string.IsNullOrEmpty(UserId)?UserId:"unavailable";
        }
        
        [System.SerializableAttribute()]
        public class RequestHashType : global::Xtee.Core.Schema.XsdString {
            
            public RequestHashType(string value) : 
                    base(value) {
                this.Validate();
            }
            
            public RequestHashType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out RequestHashType result) {
                try {
                    result = new RequestHashType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (RequestHashType value) {
                return value.Value;
            }
            
            public static implicit operator RequestHashType (string value) {
                if (value==null) {
                    return null;
                }
                return new RequestHashType(value);
            }
        }
    }
}
